﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MailServer.Server
{
    [Serializable]
    public class UserList
    {
        private List<string> users;

        public UserList()
        {
            users = new List<string>();
        }

        public void Add(string user)
        {
            if (!users.Contains(user))
                users.Add(user);
        }

        public bool Contains(string user)
        {
            return users.Contains(user);
        }

        public void Remove(string user)
        {
            if (!users.Contains(user))
                users.Remove(user);
        }

        public int Count() {
            return users.Count;
        }

        public string ElementAt(int index) {
            return users[index];
        }
    }
}
